﻿@using JULONG.WEB.Library
@using YHWE.Web.Models;
@model IEnumerable<YHWE.Web.Models.channel>
@{
Layout = null;
}
<ul id="menu" class="linkHack">
    <li class="selected"><a  href="/Home/Index">首页</a></li>
@foreach (var item in Model) {
    <li>
    @switch((ChannelTypeEnum)Enum.Parse(typeof(ChannelTypeEnum),item.type,true)){
        case ChannelTypeEnum.列表:
            @Html.ActionLink(item.name, "Index/" + item.ID, "document", new { @name = item.name }, null)
            break;
        case ChannelTypeEnum.文档:
            @Html.ActionLink(@item.name, "view/"+item.ID, "siteLibrary",new { @name = item.name }, null)
                                    break;
        case ChannelTypeEnum.外部:
            @Html.ActionLink(@item.name, "view" + item.ID, "siteLibrary", new { @name = item.name }, null)
                                    break;
        case ChannelTypeEnum.无:
            @item.name
            break;
            
    }
    @if (item.channel_sub.Any()){

         <ul class="subMenu">
         <div style=" position:absolute; background:url(/Content/images/subMenuBar_ico.png);width:36px;height:42px; top:-30px;left:-10px"></div>
        @foreach (var subItem in item.channel_sub)
        {

            switch ((ChannelTypeEnum)Enum.Parse(typeof(ChannelTypeEnum), subItem.type, true))
            {
                case ChannelTypeEnum.列表:

                <li>@Html.ActionLink(subItem.name, "Index/" + subItem.ID, "document", new { @name = subItem.name }, null)</li>
                                        break;
                case ChannelTypeEnum.文档:
            <li>@Html.ActionLink(subItem.name, "view/" + subItem.ID, "siteLibrary", new { @name = subItem.name }, null)</li>
                                    break;
                case ChannelTypeEnum.外部:
            <li>@Html.ActionLink(subItem.name, "view" + subItem.ID, "siteLibrary", new { @name = subItem.name }, null)</li>
                                    break;
                case ChannelTypeEnum.无:
                <li>@subItem.name</li>
                                        break;

            }
        }
        </ul>
        
    }
    </li>
}
</ul>

@*            <ul id="menu" class="linkHack">
                    <li class="selected"><a  href="/Home/Index">首页</a></li>
                    <li>学校介绍
                        <ul class="subMenu">
                            <div style=" position:absolute; background:url(/Content/images/subMenuBar_ico.png);width:36px;height:42px; top:-30px;left:-10px"></div>
                            <li><a  href="/SiteLibrary/view/学校概况">学校概况</a></li>
                            <li><a  href="/SiteLibrary/view/师职介绍">师职介绍</a></li>
                            <li><a  href="/SiteLibrary/view/办学成绩">办学成绩</a></li>
                            <li><a  href="/SiteLibrary/view/校长寄语">校长寄语</a></li>
                        </ul>
                    </li>
                    <li>办学特点
                        <ul class="subMenu">
                             <div style=" position:absolute; background:url(/Content/images/subMenuBar_ico.png);width:36px;height:42px; top:-30px;left:-10px"></div>

                            <li><a  href="/SiteLibrary/view/授课模式">授课模式</a></li>
                            <li><a  href="/SiteLibrary/view/课程设置">课程设置</a></li>
                        </ul>
                    </li>
                    <li><a href="/document/index/1">学校动态</a></li>
                    <li><a href="/document/index/2">相册</a></li>
                    <li><a href="/SiteLibrary/view/入学帮助">入学帮助</a></li>
                    <li><a href="/SiteLibrary/view/课外培训">课外培训</a></li>


            </ul>*@
            <script type="text/javascript">
                var linkss = document.getElementById("menu").getElementsByTagName("a");
                var loc = self.location.href.toUpperCase();

                for (var i = 0; i < linkss.length; i++) {
                    //alert(loc+"\n"+linkss[i].attributes["href"].value.toUpperCase()+"\n"+loc.indexOf(linkss[i].attributes["href"].value.toUpperCase()))
                    if (loc.indexOf(linkss[i].attributes["href"].value.toUpperCase()) > 0) {

                        linkss[i].className = "focus";

                   }
                }
            </script>